package com.sina.weibo.sdk.web.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.TextView;

public class LoadingBar extends TextView {
    private Runnable ˊ = new Runnable(this) {
        final /* synthetic */ LoadingBar ˊ;

        {
            this.ˊ = r1;
        }

        public void run() {
            this.ˊ.ˏ = this.ˊ.ˏ + 1;
            this.ˊ.ˏ(this.ˊ.ˏ);
        }
    };
    private Handler ˋ;
    private Paint ˎ;
    private int ˏ;
    private int ॱ;

    public LoadingBar(Context context) {
        super(context);
        ˏ(context);
    }

    public LoadingBar(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        ˏ(context);
    }

    public LoadingBar(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        ˏ(context);
    }

    private void ˏ(Context context) {
        this.ˋ = new Handler();
        this.ˎ = new Paint();
        ˊ();
    }

    public void ˊ() {
        this.ॱ = -11693826;
    }

    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        this.ˎ.setColor(this.ॱ);
        canvas.drawRect(ˎ(), this.ˎ);
    }

    private Rect ˎ() {
        return new Rect(0, 0, (getLeft() + (((getRight() - getLeft()) * this.ˏ) / 100)) - getLeft(), getBottom() - getTop());
    }

    public void ˏ(int i) {
        if (i < 7) {
            this.ˋ.postDelayed(this.ˊ, 70);
        } else {
            this.ˋ.removeCallbacks(this.ˊ);
            this.ˏ = i;
        }
        invalidate();
    }
}
